package nl.hro.mobiqueen.ui;

import nl.hro.mobiqueen.R;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.google.android.maps.*;

public abstract class MobiBaseMaps extends MapActivity {

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        LoadMenu(menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        Intent intent = null;

		int itemID = item.getItemId();

		Log.i("Menu", "ItemID: " + itemID);
		Log.i("Menu", "btnPlattegrond: " + R.id.btnPlattegrond);
		Log.i("Menu", "btnProgramma: " + R.id.btnProgramma);
		//Log.i("Menu", "btnInstellingen: " + R.id.btnInstellingen);

        switch (itemID) {
            case R.id.btnPlattegrond:
                intent = new Intent(this, Plattegrond.class);
                break;
            case R.id.btnProgramma:
                intent = new Intent(this, Programma.class);
                break;
            case R.id.btnInstellingen:
                intent = new Intent(this, Instellingen.class);
                break;
            default:
                throw new IllegalArgumentException("Type not supported.");
        }

        if (intent != null) {
            startActivity(intent);
        }

        return super.onOptionsItemSelected(item);
    }

    public void LoadMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.mobi_menu, menu);
    }
}
